luci-app-acme: option staging: show the flag only for letsencrypt
authorSergey Ponomarev <[email protected]>
Mon, 3 Jun 2024 11:42:41 +0000 (14:42 +0300)
committerToke Høiland-Jørgensen <[email protected]>
Tue, 7 Oct 2025 12:01:06 +0000 (14:01 +0200)
Signed-off-by: Sergey Ponomarev <[email protected]>
applications/luci-app-acme/htdocs/luci-static/resources/view/acme.js

index 8ceaf417f5296686a9b5d0b582a872e7a61cc4b6..4f526fe6a1f13646a68b64a9f41e964e9a1872e5 100644 (file)
@@ -174,15 +174,6 @@ return view.extend({
                o.modalonly = true;
 
 
-               o = s.taboption('advanced', form.Flag, 'staging', _('Use staging server'),
-                       _(
-                               'Get certificate from the Letsencrypt staging server ' +
-                               '(use for testing; the certificate won\'t be valid).'
-                       )
-               );
-               o.rmempty = false;
-               o.modalonly = true;
-
                o = s.taboption('advanced', form.ListValue, 'key_type', _('Key type'),
                        _('Key size (and type) for the generated certificate.')
                );
@@ -217,13 +208,24 @@ return view.extend({
 
                o = s.taboption('advanced', form.Value, "acme_server", _("ACME server URL"),
                        _('Use a custom CA instead of Let\'s Encrypt.') +       ' ' + _('Custom ACME server directory URL.') + '<br />' +
-                       '<a href="https://github.com/acmesh-official/acme.sh/wiki/Server" target="_blank">' + _('See more') + '</a>'
+                       '<a href="https://github.com/acmesh-official/acme.sh/wiki/Server" target="_blank">' + _('See more') + '</a>' + '<br />'
+                       + _('Default') + ' <code>letsencrypt</code>'
                );
-               o.depends("staging", "0");
                o.placeholder = "https://api.buypass.com/acme/directory";
                o.optional = true;
                o.modalonly = true;
 
+               o = s.taboption('advanced', form.Flag, 'staging', _('Use staging server'),
+                       _(
+                               'Get certificate from the Letsencrypt staging server ' +
+                               '(use for testing; the certificate won\'t be valid).'
+                       )
+               );
+               o.depends('acme_server', '');
+               o.depends('acme_server', 'letsencrypt');
+               o.optional = true;
+               o.modalonly = true;
+
                o = s.taboption('advanced', form.Value, 'days', _('Days until renewal'));
                o.optional    = true;
                o.placeholder = 'acme.sh default (60 days)';